const router = require('koa-router')();
const interest = require('../modules/score');

//获取数据
router.get('/schoolscore',async(ctx,next) => {
    ctx.body = await interest.getschoolScore();
})
//增加数据
router.post('/schoolscore',async(ctx,next) => {
    ctx.body = await interest.addschoolScore(ctx.request.body);
})
//删除数据
router.delete('/schoolscore/:school_name/:exam_year',async(ctx,next) => {
    ctx.body = await interest.deleteschoolScore(ctx.params);
})
//修改数据
router.put('/schoolscore',async(ctx,next)=>{
    ctx.body = await interest.putschoolScore(ctx.request.body);
})

module.exports = router;
